package org.blog.api;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.blog.entity.BlogUser;
import org.blog.service.BlogUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Slf4j
@RestController
@Api("用户模块")
@RequestMapping("/api/user")
public class BlogUserController {
    @Resource
    private BlogUserService blogUserService;

    @ApiOperation("获取所有用户")
    @GetMapping("/getAll")
    public List<BlogUser> getAll() {
        return blogUserService.findAll();
    }
}
